package model

import "gin-admin/enumeration"

type Menu struct {
	BaseModel
	ParentID  string                `gorm:"index;default:'';comment:父级菜单"`
	Level     enumeration.MenuLevel `gorm:"default:1;comment:菜单层级"`
	Path      string                `gorm:"size:256;default:'';comment:菜单完整路径"`
	Name      string                `gorm:"size:64;not null;unique;comment:菜单名称"`
	Code      string                `gorm:"size:64;not null;unique;comment:菜单编码"`
	Url       string                `gorm:"size:256;default:'';comment:菜单URL"`
	Icon      string                `gorm:"default:'';comment:菜单图标"`
	IsRouter  bool                  `gorm:"default:true;comment:是否路由菜单"`
	KeepAlive bool                  `gorm:"default:false;comment:是否缓存路由"`
	IsHidden  bool                  `gorm:"default:false;comment:是否隐藏"`
	Roles     []RoleMenu            `gorm:"foreignKey:MenuID;references:ID;comment:角色菜单关系"`
}
